<?php
$my_query = db_get_list_post_in_post_type_nopage_metakey(5, 'slide-show','date', 'DESC', $wpdb->prefix.'display', 'display');
query_posts($my_query);
?>
<div id="slideshow">
            	<div id="faded">
                	<ul>
                	<?php
                	if(have_posts())
                	{
                		while (have_posts())
                		{
                			the_post();
                			$postID = get_the_ID();
                			$title = get_the_title($postID);
                			$url = get_bloginfo('home');
                			$perlink = get_post_meta($postID,$wpdb->prefix.'url',true);
                			
                			if($perlink)
                				$url = $perlink;
                			$thumbnail = db_get_post_meta($postID,$wpdb->prefix.'thumbnail');
                			?>
                			<li>
		                        <a href="<?php echo $perlink;?>" title="<?php echo $title;?>" rel="nofollow">
		                        <img src="<?php echo $thumbnail;?>" alt="<?php echo $title;?>"  /></a>
		                        <div class="box-title">
		                            <a href="<?php echo $url;?>"><?php echo $title;?></a>
		                        </div>
		                    </li>
                			<?php 
                		}
                		wp_reset_query();
                	} 
                	else 
                	{
                		echo '<li>No slide show.</li>';
                	}
                	?>
                </ul>            
                </div>
            </div>